﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace jiuyuan.Migrations
{
    /// <inheritdoc />
    public partial class AddEffectConfigTable : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "参数",
                table: "持续效果表",
                type: "jsonb",
                nullable: false,
                defaultValue: "");

            migrationBuilder.CreateTable(
                name: "效果配置表",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    名称 = table.Column<string>(type: "text", nullable: false),
                    描述 = table.Column<string>(type: "text", nullable: false),
                    效果类型 = table.Column<string>(type: "text", nullable: false),
                    触发时机 = table.Column<string>(type: "text", nullable: false),
                    持续回合数 = table.Column<int>(type: "integer", nullable: false),
                    触发概率 = table.Column<float>(type: "real", nullable: false),
                    参数 = table.Column<string>(type: "jsonb", nullable: false),
                    创建时间 = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
                    更新时间 = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
                    是否启用 = table.Column<bool>(type: "boolean", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_效果配置表", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "效果配置表");

            migrationBuilder.DropColumn(
                name: "参数",
                table: "持续效果表");
        }
    }
}
